package com.ztmmm.exception;

import com.ztmmm.common.vo.ApiRest;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExcHandler {
    @ExceptionHandler(ServiceException.class)
    @ResponseBody
    public ApiRest handler1(ServiceException serviceException){
       return ApiRest.failure(serviceException.getMessage(),null);
    }
}
